﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML >
<html>
	<head>
		<base href="<%=basePath%>">

		<title>我的订单</title>

		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<meta name="viewport"
			content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<link rel="stylesheet"
			href="<%=request.getContextPath()%>/admin/css/pintuer.css">
		<script src="<%=request.getContextPath()%>/admin/js/jquery.js"></script>
		<script src="<%=request.getContextPath()%>/admin/js/pintuer.js"></script>
	</head>

	<body style="background: #F0F0F0; font-size: 12px;">
		<s:if test="style=='待付款'">
			<a href="order!findbystatus.action?style=待付款">
				<div style="border-bottom: 2px solid red; position: fixed; width: 25%; height: 50px; text-align: center; left: 0px; top: 0px; background-color: white; color: #A3A3A3;">
					<span style="position: relative; top: 5px;"
						class="icon-spinner text-big text-#A3A3A3"></span>
					<div style="position: relative; top: 10px; font-size: 10px;">
						待付款
					</div>
				</div> </a>
		</s:if>
		<s:else>
			<a href="order!findbystatus.action?style=待付款">
				<div
					style="position: fixed; width: 25%; height: 50px; text-align: center; left: 0px; top: 0px; background-color: white; color: #A3A3A3;">
					<span style="position: relative; top: 5px;"
						class="icon-spinner text-big text-#A3A3A3"></span>
					<div style="position: relative; top: 10px; font-size: 10px;">
						待付款
					</div>
				</div> </a>
		</s:else>

		<s:if test="style=='已付款'">
			<a href="order!findbystatus.action?style=已付款">
				<div style="border-bottom: 2px solid red; position: fixed; width: 25%; height: 50px; text-align: center; left: 25%; top: 0px; background-color: white; color: #A3A3A3;">
					<span style="position: relative; top: 5px;"
						class="icon-dollar (alias)   text-big text-#A3A3A3"></span>
					<div style="position: relative; top: 10px; font-size: 10px;">
						已付款
					</div>
				</div> </a>
		</s:if>
		<s:else>
			<a
				href="order!findbystatus.action?style=已付款">
				<div style="position: fixed; width: 25%; height: 50px; text-align: center; left: 25%; top: 0px; background-color: white; color: #A3A3A3;">
					<span style="position: relative; top: 5px;"
						class="icon-dollar (alias)  text-big text-#A3A3A3"></span>
					<div style="position: relative; top: 10px; font-size: 10px;">
						已付款
					</div>
				</div> </a>
		</s:else>


		<s:if test="style=='已发货'">
			<a
				href="order!findbystatus.action?style=已发货">
				<div
					style="border-bottom: 2px solid red; position: fixed; width: 25%; height: 50px; text-align: center; left: 50%; top: 0px; background-color: white; color: #A3A3A3;">
					<span style="position: relative; top: 5px;"
						class="icon-thumbs-o-up   text-big text-#A3A3A3"></span>
					<div style="position: relative; top: 10px; font-size: 10px;">
						已发货
					</div>
				</div> </a>
		</s:if>
		<s:else>
			<a
				href="order!findbystatus.action?style=已发货">
				<div
					style="position: fixed; width: 25%; height: 50px; text-align: center; left: 50%; top: 0px; background-color: white; color: #A3A3A3;">
					<span style="position: relative; top: 5px;"
						class="icon-thumbs-o-up   text-big text-#A3A3A3"></span>
					<div style="position: relative; top: 10px; font-size: 10px;">
						已发货
					</div>
				</div> </a>
		</s:else>


		<s:if test="style=='已完成'">
			<a href="order!findbystatus.action?style=已完成">
				<div
					style="border-bottom: 2px solid red; position: fixed; width: 25%; height: 50px; text-align: center; left: 75%; top: 0px; background-color: white; color: #A3A3A3;">
					<span style="position: relative; top: 5px;"
						class="icon-legal (alias)   text-big text-#A3A3A3"></span>
					<div style="position: relative; top: 10px; font-size: 10px;">
						已完成
					</div>
				</div> </a>
		</s:if>
		<s:else>
			<a href="order!findbystatus.action?style=已完成">
				<div
					style="position: fixed; width: 25%; height: 50px; text-align: center; left: 75%; top: 0px; background-color: white; color: #A3A3A3;">
					<span style="position: relative; top: 5px;"
						class="icon-legal (alias)  text-big text-#A3A3A3"></span>
					<div style="position: relative; top: 10px; font-size: 10px;">
						已完成
					</div>
				</div> </a>
		</s:else>

		<s:if test="msg=='null'">
			<img
				style="position: relative; top: 100px; left: 60px; width: 250px;; height: 250px;"
				src="<%=request.getContextPath()%>/admin/images/noorder.png" />
		</s:if>
		<br/>
		<br/>
		<br/>
		
		<s:iterator value="orders" id="o">
			<div class="panel  order">
				<div class="panel-head" style="color:gray;line-height:20px;">
					<div class="line-big">
						<div class="x7">
							订单号：
							<span style="color:gray;"><s:property value="code" /></span>
						</div>
						<div class="x5">
							状态:
							<span style="color:red;"><s:property value="status" /></span>
						</div>
						<div style="clear: both;"></div>
					</div>
					<div class="line-big">
						<div class="x7">
							支付方式:
							<span style="color:gray;"><s:property value="paymethod"/></span>
						</div>
						<s:if test="#o.isShaidan!='yes' && #o.status!='待付款'">
							<div class="x5">
								<a href="order!shaidan.action?order.code=<s:property value="code"/>"><span style="font-size:14px;border-radius:10%;border:1px solid #14D212;color:#14D212;">晒单赚积分</span></a>
							</div>
						</s:if>
						<div style="clear: both;"></div>
					</div>
					<div class="line-big">
						<div class="x6">
							收货人:
							<s:property value="name"/>
						</div>
						<div class="x6">
							<s:property value="phone"/>
						</div>
						<div style="clear: both;"></div>
					</div>
					<div class="line-big">
						<div class="x12">
							收货地址:
							<s:property value="province"/>
							<s:property value="city"/>
							<s:property value="qu"/>
							<s:property value="address"/>
						</div>
					</div>
				</div>
					<div class="panel-body">
					<s:iterator value="order0s">
						<div class="line-big order0" style="margin-top: 5px;">
						<div class="x1">
						</div>
						<div class="x3">
							<div id="img">
								<img height="60" width="60"
									src="<%=request.getContextPath()%>/<s:property value="product.img"/>" />
							</div>
						</div>
						<div class="x8">
							<s:property value="product.title" />
							<br/>
							单价
							<font color="red"><strong>￥<s:property
										value="product.price" />
							</strong>
							</font>
							<br>
							数量
							<s:property value="num" />
						</div>
						<div style="clear: both;"></div>
					</div>
					<br/>
					
					</s:iterator>
					
					<br/>
					总价：
					<font color="red"><strong>￥<s:property
								value="allprice" />
					</strong>
					</font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<s:if test='status=="待付款"'>
						<a
							href="<%=request.getContextPath()%>/w/cart!pay.action?order1.id=<s:property value="id"/>"><button
								type="button" class="button button-little border-blue">
								付款
							</button>
						</a>&nbsp;&nbsp;&nbsp;&nbsp;
						<a
							href="#" onclick="return false;">
							<button onclick="del(<s:property value="id"/>,this);"
								type="button" class="button button-little border-blue">
								删除
							</button>
						</a>
					</s:if>
				</div>
			</div>
			<br/>
		</s:iterator>
		<br><br><br><br><br><br>
	<s:include value="/w/tmpfoot.jsp"></s:include>	
	<script type="text/javascript">
		function del(id,bt){
			$.ajax({
				url:"cart!delorder.action",
				type:"post",
				data:{"order1.id":id},
				dataType:"json",
				success:function(data){
					if(data=="删除成功"){
						$(bt).parents(".order").remove();
						alert(data);
					}else{
						alert(data);
					}
				},
				error:function(){
					alert("删除失败");
				}
				})
		}
	</script>
	
	</body>
</html>
